<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>引流图片生成器</title>
</head>
<body>
    <h2>引流图片生成器</h2>
    <label for="captchaText">请输入引流文字:</label>
    <input type="text" id="captchaText" name="captchaText">
</br>
    <button onclick="generateCaptcha()">生成图片</button>
  </br>
    <span>仅供学习交流，请勿生成奇怪的东西</span>
    </br>
      <div id="captchaImage"></div>
    <script>
        function generateCaptcha() {
            const text = document.getElementById('captchaText').value;
            fetch('/generate-captcha', {
                method: 'POST',
                headers: {
                    'Content-Type': 'application/json'
                },
                body: JSON.stringify({ text: text })
            })
            .then(response => response.text())
            .then(data => {
                document.getElementById('captchaImage').innerHTML = data;
            })
            .catch(error => console.error('Error:', error));
        }
    </script>
</body>
</html>
